﻿@model AutomatedTestDataManagement.Models.TestScenarioTest

@if(ViewData["Remove"] == null)
{
                      <tr>
                           <td>
                               @Html.DisplayFor(modelItem => modelItem.Test.TestName)
                           </td>
                           <td>
                               @Html.DisplayFor(modelItem => modelItem.Test.TestDescription)
                           </td>
                           <td>
                               @Html.HiddenFor(modelItem => modelItem.ScenarioTestID)
                               @Html.HiddenFor(modelItem => modelItem.ScenarioID)
                               @Html.HiddenFor(modelItem => modelItem.TestID)
                               @if (ViewData["ForDelete"] != null) 
                               { 
                                   @Html.DisplayFor(modelItem => modelItem.TestNumber) 
                               }
                               else
                               {
                                    @Html.EditorFor(modelItem => modelItem.TestNumber)
                               }
                               @Html.ValidationMessageFor(modelItem => modelItem.TestNumber)
                           </td>
                           <td>
                               @if (ViewData["SuiteID"] != null)
                               {
                                   if (ViewData["ForDelete"] == null)
                                   {
                                        @Html.ActionLink("Edit Test", "Edit", "Test", new { id = Model.TestID, scenarioID = Model.ScenarioID, suiteID = ViewData["SuiteID"] }, null) @Html.Encode(" | ")
                                        @Html.ActionLink("Remove Test", "Edit", "Test", new { id = Model.TestID, scenarioID = Model.ScenarioID, suiteID = ViewData["SuiteID"], returnToView = "Edit" }, null)
                                    }
                                    else
                                    {
                                        @Html.ActionLink("Remove Test", "Edit", "Test", new { id = Model.TestID, scenarioID = Model.ScenarioID, suiteID = ViewData["SuiteID"], returnToView = "Delete" }, null)
                                    }
                               }
                               else 
                               {
                                   if (ViewData["ForDelete"] == null)
                                   { 
                                        @Html.ActionLink("Edit Test", "Edit", "Test", new { id = Model.TestID, scenarioID = Model.ScenarioID }, null) @Html.Encode(" | ")
                                        @Html.ActionLink("Remove Test", "Delete", "ScenariosTest", new { id = Model.ScenarioTestID, returnToView = "Edit" }, null)
                                    }
                                    else
                                    {
                                        @Html.ActionLink("Remove Test", "Delete", "ScenariosTest", new { id = Model.ScenarioTestID, returnToView = "Delete" }, null)
                                    }
                               }
                           </td>
                       </tr>
}
else
{
    <tr>
        <td>
            @Html.DisplayFor(m => m.TestScenario.ScenarioName)
        </td>
        <td>
            @Html.DisplayFor(m => m.TestScenario.ScenarioDescription)
        </td>
        <td>
            @Html.ActionLink("Remove Test from Scenario", "Delete", "ScenariosTest", new{ id=Model.ScenarioTestID, testID = Model.TestID, returnToView = "Delete"}, null)
        </td>
    </tr>
}